home *** CD-ROM | disk | FTP | other *** search
- /*
-
- QED-ShowError
-
- This Arexx program displays the errors generated by the PCQ Pascal
- compiler using the QED text editor. It should be called as
- follows:
-
- QED-ShowError SourceFile OutputFile ErrorFile
-
- QED-ShowError reads the errorfile, which must have been generated
- by PCQ Pascal in "quiet" mode. It displays the first error
- in the appropriate source file (not necessarily the SourceFile),
- then erases the OutputFile and ErrorFile.
-
- This file was designed to be an error handler for the PCQ make
- utility. It might work for other purposes, but I'd be careful if
- I were you.
-
- To use this program, you'll need to include the following line in
- your configuration file:
-
- CompilerError rx QED-ShowError \s \d \e
-
- You'll also need QED and Arexx. Arexx is, of course, a commercial
- program, and QED is a very good shareware text editor written by:
-
- Darren M. Greenwald
- 462 Devon Court
- Downingtown, PA 19335
- USA
-
- */
-
- /* Read the command line parameters */
-
- parse arg SourceFileName OutputFileName ErrorFileName .
-
- options results
-
-
- /* Get the first error */
-
- if open(logfile, ErrorFileName, 'R') then do
-
- if eof(logfile) then do /* There were no errors */
- FileName = SourceFileName
- LineNo = 1
- ColumnNo = 1
- ErrorText = "No Errors"
- end; else do
- ErrorString = readln(logfile)
-
- /* This first test is just a reminder, in case you want to */
- /* process all errors. "Abort" would never come first. */
-
- if ErrorString = "Compilation Aborted" then do
- address command 'delete >nil:' outputfile
- 'okay1 Compilation Aborted'
- exit
- end
-
- if ErrorString ~= "" then do
- parse var ErrorString '"' FileName '" At ' LineNo,
- ',' ColumnNo ' :' ErrorText
- end; else do
- FileName = SourceFileName
- LineNo = 1
- ColumnNo = 1
- ErrorText = "No Errors"
- end
- end
- close(logfile)
- end; else do
- say 'Could not open error file'
- exit
- end
-
- /* Load QED */
-
- if ~show(Ports,'QED_REXX') then do
- address command 'RUN QED -PQED_REXX'
- do until show(Ports,'QED_REXX')
- address command wait 1
- end
- end
-
- address 'QED_REXX'
-
- loadfile FileName
-
- 'GOTO' LineNo /* Move to the correct line */
- 'BOL' /* Make sure we're at the beginning */
- do for ColumnNo
- 'CRRIGHT'
- end
-
- 'MESSAGE Error:' || ErrorText
-
- /* Delete the temporary files */
-
- address command 'delete >Nil:' ErrorFileName
- address command 'delete >Nil:' OutputFileName
-
-